package com.fitz.registry;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;

/**
 * @author gousl01
 * @date 2021/5/1 10:38
 * @desc
 */
@ToString
@Data
@NoArgsConstructor
public class InstanceInfo implements Serializable {

    private String host;

    private int port;

    private boolean isAlive;

    private String serviceName;

    private byte serializerType;

    /**
     * 服务提供者需要暴露的服务
     */
    private HashMap<String,Object> handlerMap;

    public InstanceInfo(String host, int port) {
        this.host = host;
        this.port = port;
    }

    public String serverKey(){
        return host+":"+port;
    }
}
